import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
const IdKey = 'Customer-Id'
const NameKey = 'Customer-Name'
const AvatarKey = 'Customer-Avatar'
export function getToken() {
  // console.log("getToken："+Cookies.get(TokenKey))
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  console.log("setToken")
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  console.log("removeToken")
  return Cookies.remove(TokenKey)
}


export function getCustomerId() {
  // console.log("getCustomerId："+Cookies.get(IdKey))
  return Cookies.get(IdKey)
}

export function setCustomerId(id) {
  console.log("setCustomerId")
  return Cookies.set(IdKey, id)
}

export function removeCustomerId() {
  console.log("removeCustomerId")
  return Cookies.remove(IdKey)
}



export function getCustomerName() {
  return Cookies.get(NameKey)
}

export function setCustomerName(name) {
  console.log("setCustomerName")
  return Cookies.set(NameKey, name)
}

export function removeCustomerName() {
  return Cookies.remove(NameKey)
}


export function getCustomerAvatar() {
  console.log("getAvatar"+ Cookies.get(AvatarKey))
  return Cookies.get(AvatarKey)
}

export function setCustomerAvatar(avatar) {
  console.log("setCustomerAvatar"+import.meta.env.VITE_APP_BASE_API+avatar)
  return Cookies.set(AvatarKey, import.meta.env.VITE_APP_BASE_API+avatar)
}

export function removeCustomerAvatar() {
  return Cookies.remove(AvatarKey)
}
